'use strict';
const uniPush = uniCloud.getPushManager({
	appId: "__UNI__FF297C4"
}) //注意这里需要传入你的应用appId，用于指定接收消息的客户端
//https://fc-mp-fc40ed0a-38b9-4e1a-beb7-dffe9c0c830c.next.bspapp.com/unipush?push_clientid=6044045bcbdccc4aa005829a71d073c2&title=%E9%80%9A%E7%9F%A5%E6%A0%8F%E6%98%BE%E7%A4%BA%E7%9A%84%E6%A0%87%E9%A2%98&content=%E9%80%9A%E7%9F%A5%E6%A0%8F%E6%98%BE%E7%A4%BA%E7%9A%84%E5%86%85%E5%AE%B9&payload.text=%E4%BD%93%E9%AA%8C%E4%B8%80%E4%B8%8Buni-push2.0
exports.main = async (event, context) => {
	let body = JSON.parse(event.body)
	let clients = body.clientIds
	console.log(body)
	console.log(body.clientIds)
	console.log(body.payload)
	return await uniPush.sendMessage({
		"push_clientid": body.clientIds, //填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
		"title": "",
		"content": "",
		"payload": {
			"text": body.payload
		}
	})
};